package com.my.socket;

/**
 * Created by ZhongGang
 * at 2018/6/27 10:03
 */
public class StringUtils {

    public static String reverse(String value) {
        if (value == null) {
            return null;
        }

        char[] chars = value.toCharArray();
        int length = chars.length;
        char[] reversed = new char[length];
        for (int i = 0; i < length; i++) {
            reversed[i] = chars[length - 1 - i];
        }
        return new String(reversed);
    }
}
